#ifndef DATA_ITILE_HPP
#define DATA_ITILE_HPP

#include <types.hpp>
#include <util/vec3.h>

namespace Data {

/**
 * @brief The ITile class is interface for Data::Tile that represents a quadratic
 * chunk of landscape surface. Landscape described with <map width>*<map height>
 * tiles.
 */
class ITile
{
public:
    static const uint KEYPOINTS_FREQUENCE = 6;
    static const uint KEYPOINTS_COUNT = KEYPOINTS_FREQUENCE * KEYPOINTS_FREQUENCE;

    virtual ~ITile() {}

    /**
     * @brief ground Get index of ground texture variant
     * @return Index of ground texture
     */
    virtual uint ground() const = 0;

    /**
     * @brief keyPoint
     * @param index Index of key point in range [0..KEYPOINTS_COUNT]
     * @return Landscape height at tile's key point with given index
     */
    virtual float keyPoint(uint index) const = 0;

    /**
     * @brief keyNormal
     * @param index Index of key point in range [0..KEYPOINTS_COUNT]
     * @return Normal to land surface for key point with given index
     */
    virtual const vec3f &keyNormal(uint index) const = 0;
};

} // namespace Data

#endif // DATA_ITILE_HPP
